<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
<head>
<title>合格证补录</title>
	<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
	<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
	<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
<div class="navigation">
	    <span><a href="javascript:window.history.back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:window.history.back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>合格证管理&gt;&gt;合格证批量补录
    </div>
<div class="xt_main_right_center">
<form name="searchForm" id="searchForm" onSubmit="return checkSubmit();" method="post" action="save.do">
<input type="hidden" name="redirectUrl" value='<s:property value='redirectUrl'/>'/>
<input type="hidden" name="id" value="${applyCer.id }"/>
<table width="100%" border="0">
  <tr>
    <td class="left-td-width-bg">申请人：</td>
    <td class="right-td-width-bg-left">${applyCer.user.realName }</td>
    <td class="left-td-width-bg">申请时间：</td>
    <td class="right-td-width-bg-left"><s:date name="applyDate" format="yyyy-MM-dd"/></td>
  </tr>
  <tr>
  	<td class="left-td-width-bg">选择经销店：</td>
    <td class="right-td-width-bg-left" colspan="3">
      <s:if test="mark == false">
     	 <select datatype="Require" msg="请选择4S店 " class="input" name="shopId" id="shopId">
              <s:iterator value="shops" status="i" id="b"> 
              	<option  value="${b.id}">(${b.shopMark}/${b.shopName})</option>
              </s:iterator>
            </select>
      </s:if>
      <s:elseif test="mark">
      	<input name="a" type="text" id="a" value="${shop.shopName }" readonly="readonly"></input>
      	<input type="hidden" name="shopId" id="shopId" value="${shop.id }"></input>
     </s:elseif>
    	
    </td>
  </tr>
  <tr>
    <td colspan="4" align="center">
     
      <input type="button" name="button" onclick="addOne()" id="button" value="  " class="btn_temporary"/>
      &nbsp;&nbsp;&nbsp;
      <s:if test="applyCer.id != null">
      	 <input type="button" name="button3" onclick="add()"  id="button3" value="  " class="btn_submit"/>
      </s:if>
     
    </td>
    </tr>
</table>
<div id="addList">
<s:if test="mark == true">
  <table width="100%" border="0" cellpadding="0">
    <tr>
      <td colspan="7" align="right"><label>
      	 <jysz:permission code="CM_ADDLIST_ADD"><a href="javascript:oPenAddTwo()"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a></jysz:permission>
      </label></td>
      </tr>
    <tr>
      <td class="top-td-width-bg">序号</td>
      <td class="top-td-width-bg">销售店</td>
      <td class="top-td-width-bg">金融机构</td>
      <td class="top-td-width-bg">渠道</td>
      <td class="top-td-width-bg">合格证号</td>
      <td class="top-td-width-bg">车架号</td>
      <td class="top-td-width-bg">操作</td>
    </tr>
     <s:iterator value="applyCer.applyCerLists" status="st" id="u">
    <tr>
      <td class="down-center-td-width-bg"><s:property value="#st.index+1"/></td>
      <td class="down-center-td-width-bg">${u.shop.shopName }</td>
      <td class="down-center-td-width-bg">${u.financial.name}</td>
      <td class="down-center-td-width-bg">${u.brand.name}</td>
      <td class="down-center-td-width-bg">${u.certificationNum}</td>
      <td class="down-center-td-width-bg">${u.chassis}</td>
      <td class="down-center-td-width-bg">
      
      <jysz:permission code="CM_ADDLIST_EDIT">
      	 <a href="toDetail.do?id=${u.id }"><img src="${contextPath}/images/edit.gif" onclick="" alt="编辑"/></a>
      </jysz:permission>      
      <jysz:permission code="CM_ADDLIST_DEL">
      	<a href="javascript:deleteD(${u.id })" title="删除合格证"><img src="${contextPath}/images/del.gif"  alt="删除"/>
      	</a>
      </jysz:permission>

      </td>
    </tr>
    </s:iterator>
  </table>
  </s:if>
</div>
<p>&nbsp;</p>
</form>
</div>
<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
		
<script type="text/javascript">
function addOne(){
	var searchForm = document.searchForm;
	<s:if test="mark == false"> 
		searchForm.action = "addOne.do?currentPage=${currentPage}";
	</s:if>
	<s:else>
	    searchForm.action = "index.do?currentPage=${currentPage}";
	</s:else>
	searchForm.submit();
}
function oPenAddTwo(){
	var searchForm = document.searchForm;
	searchForm.action = "oPenAddTwo.do?currentPage=${currentPage}";
	searchForm.submit();
}
function deleteD(id){
	if(confirm("确定要删除吗?")) {
	var searchForm = document.searchForm;
	searchForm.action = "deleteapplyCerList.do?currentPage=${currentPage}&applyCerListid="+id;
	searchForm.submit();
	}
}
function add(){
	var searchForm = document.searchForm;
	searchForm.action = "add.do?currentPage=${currentPage}";
	searchForm.submit();
}
function update(id,shopId){
	var searchForm = document.searchForm;
	searchForm.action = "toDetail.do?currentPage=${currentPage}&id="+id+"&shopId="+shopId;
	searchForm.submit();
}
</script>
</body>
</html>